<template>
<view class="dynamic-publish-page st-bg-color-white">
  <moment-publish :group-flag="$config.dynamicGroupFlag" @saveSuccess="goBack" @publishSuccess="goBack"></moment-publish>
</view>
</template>

<script>
import momentPublish from '../../../../../../../components/moment/web/components/app/uni-app/st-u-moment-publish/st-u-moment-publish.vue'
export default {
  components: {momentPublish},
  methods: {
    // 只有发布成功才有 moment 参数
    goBack(moment){
      // 延时一下返回，因为动作太快，导致提示信息一闪而过
     setTimeout(()=>{
       uni.navigateBack({
         delta: 1,
         success(res){
           // 向上个页面传递发布完的数据
           if (moment) {
             uni.$emit('publishSuccess', moment)
           }
         }
       })
     },1000)
    },
  }

}
</script>

<style scoped>
page{
  background-color: #FFFFFF;
}
</style>